import { request } from '@umijs/max';
import * as API from "@/services";
export async function modifyPwd(dto: API.ModifyPwd): Promise<API.RespResult<boolean>> {
    return request(`/api/v1/modify-pwd`, {
        method: 'POST',
        data: dto,
    });
}

export async function modifyExpiredPwd(dto: API.ModifyExpiredPwd): Promise<API.RespResult<boolean>> {
  return request(`/api/v1/modify-expired-pwd`, {
    method: 'POST',
    data: dto,
  });
}

export async function modifyAuthPwd(dto: API.ModifyAuthPwd): Promise<API.RespResult<boolean>> {
    return request(`/api/v1/modify-auth-pwd`, {
        method: 'POST',
        data: dto,
    });
}

export async function resetAuthPwd(dto: API.ResetAuthPwd): Promise<API.RespResult<string>> {
    return request(`/api/v1/reset-pwd`, {
        method: 'POST',
        data: dto,
    });
}

export async function createUserAuth(dto: API.Auth_Create): Promise<API.RespResult<boolean>> {
    return request(`/api/v1/user/${dto.userId}/auth`, {
        method: 'POST',
        data: dto,
    });
}

export async function deleteUserAuth(userId: API.EntityId, authId: API.EntityId): Promise<API.RespResult<boolean>> {
    return request(`/api/v1/user/${userId}/auth/${authId}`, {
        method: 'DELETE',
    });
}
